﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using TE3.Utils;

namespace TE3.Entities
{
	public class Box : DrawableEntity, IThinkable
	{
		public bool FollowMouse = false;
		private bool AddAlpha = false;
		public Box()
		{
			TextureName = "System/selector.png";
			Position.X = Mouse.GetState().X;
			Console.WriteLine("Box created!");
			Color = Color.Red;
			Size = new Int2(32, 32);
		}

		public void Think(GameTime gameTime)
		{
			if (FollowMouse)
			{
				Position.X = Mouse.GetState().X - Size.X / 2;
				Position.Y = Mouse.GetState().Y - Size.Y / 2;
			}
			if (AddAlpha)
				Alpha += 5;
			else
				Alpha -= 5;

			switch (Alpha)
			{
				case 255:
					AddAlpha = false;
					break;
				case 0:
					AddAlpha = true;
					break;
			}
		}
	}
}
